/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qdu.servlet;

import com.qdu.entity.Journal;
import com.qdu.service.JournalService;
import com.qdu.service.impl.JournalServiceImpl;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**根据关键字检索日志的Servlet
 *
 * @author Lenovo
 */
@WebServlet("/sjbks")
public class SearchJournalByKeywordServlet extends HttpServlet {
    
    JournalService journalService = new JournalServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String keyword = req.getParameter("keyword");
        System.out.println("servlet收到的关键字是："+keyword);
        List<Journal> list=journalService.findJournalByKeyword(keyword);
        req.setAttribute("jbyk_list", list);
        req.getRequestDispatcher("/journalbykwdlist.jsp").forward(req, resp);
    }
    
}
